package com.theanh.RssActivity.util;

import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.widget.TextView;
import android.widget.Toast;

import com.theanh.RssActivity.R;
import com.theanh.RssActivity.Store;

public class DialogUtils {
	public static void showToastMessage(int id) {
		try {
			Toast.makeText(Store.context, Store.context.getString(id),
					Toast.LENGTH_LONG).show();
		} catch (Exception ex) {

		}
	}
	
	public static void showDialogError(Context context,int id){
		TextView textError = new TextView(context);
			textError.setText(id);
			new AlertDialog.Builder(context)
			.setTitle(R.string.dialog_error_title)
			.setView(textError)
			.setPositiveButton(R.string.button_dialog_ok, new DialogInterface.OnClickListener(){
				public void onClick(DialogInterface dialog, int whichButton){
					
				}
			}).create().show();
	}
	
	public static void showDialogError(Context context,String msg){
		TextView textError = new TextView(context);
			textError.setText(msg);
			new AlertDialog.Builder(context)
			.setTitle(R.string.dialog_error_title)
			.setView(textError)
			.setPositiveButton(R.string.button_dialog_ok, new DialogInterface.OnClickListener(){
				public void onClick(DialogInterface dialog, int whichButton){
					
				}
			}).create().show();
	}
}
